from typing import Optional, Any
from datetime import datetime
from pydantic import BaseModel

class AuditLogBase(BaseModel):
    UserId: int
    WorkAreaId: int
    Action: str
    ResourceType: str
    ResourceId: str
    OldValue: Optional[str] = None
    NewValue: Optional[str] = None
    IPAddress: Optional[str] = None
    UserAgent: Optional[str] = None

    class Config:
        from_attributes = True

class AuditLogCreate(AuditLogBase):
    pass

class AuditLog(AuditLogBase):
    LogId: int
    CreateTime: datetime

    class Config:
        from_attributes = True 